#ifndef _WX_VALIDATE_H_
#define _WX_VALIDATE_H_

#include "wx/defs.h"

#if wxUSE_VALIDATORS

#include "wx/event.h"

class wxWindow;
class wxWindowBase;

class wxValidator : public wxEvtHandler {
  public:
    wxValidator();
    virtual ~wxValidator();
    virtual wxObject *Clone() const
    { return ( wxValidator * )NULL; }
    bool Copy( const wxValidator& val ) { m_validatorWindow = val.m_validatorWindow; return true; }
    virtual bool Validate( wxWindow *parent ) { return false; }
    virtual bool TransferToWindow() { return false; }
    virtual bool TransferFromWindow() { return false; }
    wxWindow *GetWindow() const { return ( wxWindow * )m_validatorWindow; }
    void SetWindow( wxWindowBase *win ) { m_validatorWindow = win; }
    static bool IsSilent() { return ms_isSilent; }
    static void SetBellOnError( bool doIt = true ) { ms_isSilent = doIt; }
  protected:
    wxWindowBase *m_validatorWindow;
  private:
    static bool ms_isSilent;
    DECLARE_DYNAMIC_CLASS( wxValidator )
    DECLARE_NO_COPY_CLASS( wxValidator )
};

extern const wxValidator wxDefaultValidator;

#define wxVALIDATOR_PARAM(val) val

#else // !wxUSE_VALIDATORS
class wxValidator;
#define wxDefaultValidator (*((wxValidator *)NULL))

// this macro allows to avoid warnings about unused parameters when
// wxUSE_VALIDATORS == 0
#define wxVALIDATOR_PARAM(val)
#endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS

#endif // _WX_VALIDATE_H_

